package cc.yugu.yhdw.webserver.persistence.basic;

import cc.yugu.yhdw.common.domain.basic.SmsConfig;
import cc.yugu.yhdw.common.domain.basic.SmsConfigInfo;
import cc.yugu.yhdw.common.persistence.MasterMapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
/**
 * 短信配置
 *
 * @Date:Created in 2018/6/29 11:08
 * @Author:
 * @Modified By: zjn 2018/6/29 11:08
 */
public interface SmsConfigMapper extends MasterMapper {
    /**
    * 根据主键id查询表bas_sms_config 中指定字段数据
    *
    * @Param: [id]
    * @Return: cc.yugu.yhdw.common.domain.basic.SmsConfig
    * @Author By: zjn 2018/6/29  11:08
    */
    public SmsConfig find(int id);
    /**
    * 和上面查询条件一样
    *
    * @Param: [id]
    * @Return: cc.yugu.yhdw.common.domain.basic.SmsConfigInfo
    * @Author By: zjn 2018/6/29  11:10
    */
    public SmsConfigInfo findInfo(int id);
    /**
    * 根据运营商id查询
    *
    * @Param: [agentId]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.basic.SmsConfig>
    * @Author By: zjn 2018/6/29  11:11
    */
    public List<SmsConfig> findByAgent(int agentId);
    /**
    * 按条件查询，并返回主键id行数
    *
    * @Param: [search]
    * @Return: int
    * @Author By: zjn 2018/6/29  11:12
    */
    public int findPageCount(SmsConfig search);
    /**
    * 按条件分页查询
    *
    * @Param: [search]
    * @Return: java.util.List<cc.yugu.yhdw.common.domain.basic.SmsConfig>
    * @Author By: zjn 2018/6/29  11:13
    */
    public List<SmsConfig> findPageResult(SmsConfig search);
    /**
    * 插入
    *
    * @Param: [sql]
    * @Return: int
    * @Author By: zjn 2018/6/29  11:13
    */
    public int insert(@Param("sql") String sql);
    /**
    * 插入指定数据
    *
    * @Param: [entity]
    * @Return: int
    * @Author By: zjn 2018/6/29  11:15
    */
    public int insertSmsConfig(SmsConfig entity);
    /**
    * 根据主键id更新
    *
    * @Param: [entity]
    * @Return: int
    * @Author By: zjn 2018/6/29  11:15
    */
    public int update(SmsConfig entity);
    /**
    * 根据主键id更新 余额和更新时间
    *
    * @Param: [id, balance, updateTime]
    * @Return: int
    * @Author By: zjn 2018/6/29  11:14
    */
    public int updateBalance(@Param("id") int id, @Param("balance") String balance, @Param("updateTime") Date updateTime);
    /**
    * 根据运营商id删除
    *
    * @Param: [agentId]
    * @Return: int
    * @Author By: zjn 2018/6/29  11:15
    */
    public int deleteByAgent(int agentId);
}
